import { notFound } from "next/navigation"; import { requireUser } from "@/lib/auth/session"; import { getThread } from "@/lib/inquiries/service"; import { ThreadView } from "./thread-view"; export const dynamic = "force-dynamic"; export default async function Thread({ params }: { params: Promise<{ id: string }> }) { const u = await requireUser(); const { id } = await params; let t; try { t = await getThread(id, u.id); } catch { notFound(); } return ({ id: m.id, senderId: m.senderId, body: m.body, createdAt: m.createdAt.toISOString(), readAt: m.readAt?.toISOString() ?? null })) }} />; }